package com.itheima.stock.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @author liwen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ContentRowHeight(15)
@HeadRowHeight(20)
@ColumnWidth(20)
public class StockInfoExcelDTO {

    /**
     * 编号
     */
    @ExcelProperty(value = "编号", index = 0)
    private int num;
    /**
     * 股票编码
     */
    @ExcelProperty(value = "股票编码", index = 1)
    private String code;
    /**
     * 股票名称
     */
    @ExcelProperty(value = "股票名称", index = 2)
    private String name;
    /**
     * 交易量
     */
    @ExcelProperty(value = "交易量", index = 3)
    private Long tradeAmt;
    /**
     * 前收盘价
     */
    @ExcelProperty(value = "前收盘价", index = 4)
    private BigDecimal preClosePrice;

    /**
     * 振幅
     */
    @ExcelProperty(value = "振幅", index = 5)
    private BigDecimal amplitude;
    /**
     * 交易量
     */
    @ExcelProperty(value = "交易额", index = 6)
    private BigDecimal tradeVol;
    /**
     * 涨跌 计算公式：(当前价格-前收盘价)
     */
    @ExcelProperty(value = "涨跌", index = 7)
    private BigDecimal increase;
    /**
     * 涨幅 计算公式：(当前价格-前收盘价)/前收盘价*100%
     */
    @ExcelProperty(value = "涨幅", index = 8)
    private BigDecimal upDown;
    /**
     * 当前价格
     */
    @ExcelProperty(value = "当前价格", index = 9)
    private BigDecimal tradePrice;

    /**
     * 日期
     */
    @ExcelProperty(value = "日期", index = 10)
    @DateTimeFormat("yyyy年MM月dd日")
    private LocalDate curDate;
}
